.\"   $Id: beh_debug.3,v 1.1 2002/04/04 14:54:48 ludo Exp $
.\" @(#)beh_debug.3 109 Oct 15 1995 UPMC ; Pirouz BAZARGAN SABET
.TH BEH_DEBUG 3 "October 1, 1997" "ASIM/LIP6" "BHL functions"

.so man1/alc_origin.1
.SH NAME
.PP
\fBbeh_debug\fP \- BEH structures displayer\-debugger

.SH SYNOPSIS
.PP
.nf
void beh_debug (pnt, type)
void *pnt;
char *type;
.fi

.SH PARAMETERS
.PP
.TP 10
\fIpnt\fP
pointer of the structure to be displayed
.TP 10
\fItype\fP
name of the structure to be displayed. \fItype\fP can be any of "befig",
"beout", "bereg", "bemsg", "bepor", "begen", "berin", "bebus", "beaux",
"bebux", "biabl", "binode", "beder", "bequad", "abl", "integer", "long",
"short", "character", "ptype", "chain"

.SH DESCRIPTION
.PP
When called, \fBbeh_debug()\fP displaies the structure pointed by
\fIpnt\fP then, prints the line:

.RS
COMMAND   >>
.RE

and waits for a command being entered by the user. If \fIpnt\fP is a NULL
pointer or \fItype\fP doesn\'t represent a known structure, \fBbeh_debug()\fP
exits without making any action.

.PP
To display the structure, \fBbeh_debug()\fP prints a line per field. Fields
containing immediate value (integer, character, string, ...) are displayed
in the following form:

.RS
name_of_the_field  :  value_of_the_field
.RE

.PP
Fields containing a pointer are marked by the symbol \fB\->\fP. If the field
contains a NULL pointer, the field is displayed as:

.RS
-> name_of_the_field  :
.RE

In the other case, \fBbeh_debug()\fP prints :

.RS
-> name_of_the_field  :  available
.RE

.PP
Two kinds of command are accepted by the displayer.

.PP
A command can be the name of a field containing a pointer. The command is
accepted only if the pointer is not a NULL pointer (field displayed as
"available"). When the debugger receives such a command, it first pushes the
current structure on its stack then, displaies the structure pointed by the
named field.

.PP
The second kind of commands are predefined commands :

.RS
.TP 10
\fB_exit\fP
to exit from the debugger
.TP 10
\fB_up\fP
to return to the previous structure
.TP 10
\fB_stop\fP
to put a stop mark on the current structure
.TP 10
\fB_top\fP
to return to the first structure (pointed by \fIpnt\fP)
.TP 10
\fB_back\fP
to return to the last structure marked with a stop mark
.TP 10
\fB_save\fP
to save the current structure in a static table. At most 10 structures may
be saved. (example : "_save 1" saves the current structure in the entry
number ! of the table)
.TP 10
\fB_jump\fP
to jump to a saved structure (example : "_jump 1" dislpaies the etructure
save in the entry number 1 of the table).
.TP 10
\fB_display\fP
displaies a field under a given format. (example : "_display next integer" displaies the field named \fInext\fP as an integer).
.RE

.PP
In addition to these commands, the command \fB.\fP (dot) can be used to repete
the last command.

.SH EXAMPLE
.PP
.nf
#include <beh109.h>
struct beout *beout_pnt;

beh_debug (beout_pnt , "beout");
.fi

.SH NOTES
.PP
\fBbeh_debug()\fP uses an internal stack. The message \fI"stack overflow"\fP
is printed if too many structures have been pushed on the stack.

.SH SEE ALSO
.PP
beh(3)


.so man1/alc_bug_report.1

